﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DSL
{
    class Program
    {
        static void Main(string[] args)
        {
            var content = File.ReadAllText("test.dsl");


            PrintTokenInfo(content);
            Parse(content);

            Console.ReadKey();
        }

        private static void PrintTokenInfo(string content)
        {
            var token = new SlkToken(content);
            var num = token.get();
            while (num != SlkConstants.END_OF_SLK_INPUT_)
            {
                Console.WriteLine(num + ":" + token.getCurToken());
                num = token.get();
            }
        }

        private static void Parse(string content)
        {
            var token = new SlkToken(content);
            var action = new SlkAction(token);
            var error = new SlkError(token);
            SlkParser.parse(action, token, error, 0);

        }

    }
}
